package com.student.foodAfter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.student.foodAfter.entity.Orderlist;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderlistMapper extends BaseMapper<Orderlist> {

    @Select(" select count(*) as  num,foodname from orderlist group by foodname order by num desc; ")
    List<Object> getTopFood1();
    @Select(" select foodname,count(*) as  num from orderlist group by foodname order by num desc; ")
    List<Object> getTopFood2();

    @Select(" select foodname,count(*) as  num from orderlist group by foodname order by num ; ")
    List<Object> getEndFood1();

    @Select(" select count(*) as  num,foodname from orderlist group by foodname order by num ; ")
    List<Object> getEndFood2();
}
